package com.cari.oa.service;

import java.sql.Timestamp;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cari.oa.dao.BaseDao;
import com.cari.oa.dao.CustomerContactDao;
import com.cari.oa.domain.CustomerContactEntity;

@Service
@Transactional(rollbackFor = Exception.class)
public class CustomerContactService extends BaseService<CustomerContactEntity> {

	@Resource
	private CustomerContactDao customerContactDao;
	@Override
	public BaseDao<CustomerContactEntity> getDao() {
		return customerContactDao;
	}

	@Transactional(readOnly = true)
	public List<CustomerContactEntity> getPage(String name, String company, String province, Timestamp beginTime, Timestamp endTime, Integer page, Integer size){
		return customerContactDao.getPage(name, company, province, beginTime, endTime, page, size);
	}
	
	@Transactional(readOnly = true)
	public long getCount(String name, String company, String province, Timestamp beginTime, Timestamp endTime){
		return customerContactDao.getCount(name, company, province, beginTime, endTime);
	}
}
